package com.dq.controller;

import com.dq.mapper.QQFriendMapper;
import com.dq.mapper.QQLoginMapper;
import com.dq.mapper.QQUserMapper;
import com.dq.model.MyQqServer;
import com.dq.netty.NettyServer;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: Dang Qi
 * @Date: 2021/5/9 15:03
 * @Description:
 */
@Controller
@RequestMapping("/")
public class ServerController {
    @Autowired
    QQLoginMapper loginMapper;

    @Autowired
    QQUserMapper userMapper;

    @Autowired
    QQFriendMapper friendMapper;

    @Autowired
    NettyServer nettyServer;
    private MyQqServer qqServer;
    @GetMapping("/start")
    public ResponseEntity start(){
        nettyServer.start();
        return ResponseEntity.ok("ok");
    }
    @GetMapping("/close")
    public ResponseEntity close(){
        nettyServer.close();
        return ResponseEntity.ok("ok");
    }
}
